package com.huitone.smspfm.dao.oracle;

import java.util.List;

import org.springframework.jdbc.core.BeanPropertyRowMapper;

import com.huitone.smspfm.dao.oracle.entity.GateSwitch;


public class GateSwitchDao extends BaseDao<GateSwitch> {

	@Override
	public List<GateSwitch> getAllObj() {
		return jdbcTemplate.query("SELECT * FROM " + tableName + " WHERE STATUS = '1'", new BeanPropertyRowMapper<GateSwitch>(GateSwitch.class));
	}
	
	public int updateLineType(String lineType,String linkId){
		return jdbcTemplate.update("UPDATE "+tableName+ " SET LINE_TYPE = '" + lineType +"' WHERE GATE_LINK_ID = '" + linkId +"' AND STATUS = '1'");
	}

}
